<?php
class cmspad_validator_email{
	
	public function validate($value){
		return preg_match('/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/', $value) !== 0;
	}
	
	public static function getJavascript($value){
		return "return /^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$/.test($value);";
	}
}
?>
